﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Invoicing.Pubs
{

    public class PageHandle: System.Web.UI.Page
    {



        protected void Page_Render(object sender, EventArgs e)
         {

      
            //获取排序参数 
             if (Request["orderField"] != null)
             {
                 OrderField = Request["orderField"].ToString();
             }
             //获取排序正序/反序
             if (Request["orderDesc"] != null)
             {
                 OrderDesc = Request["orderDesc"].ToString();
             }
         }


        #region 封装分页对象

        private int _pageNumShown = 10;
        /// <summary>
        /// 导航显示数
        /// </summary>
        public int PageNumShown
        {
            get { return _pageNumShown; }
            set { _pageNumShown = value; }
        }

        private string _orderDesc = "desc";

        public string OrderDesc
        {
            get { return _orderDesc; }
            set { _orderDesc = value; }
        }



        private int _currentPageindex = 1;
        /// <summary>
        /// 当前显示的页数，默认为1
        /// </summary>
        public int CurrentPageindex
        {
            get { return _currentPageindex; }
            set {
                //pageNum

                //if (Request["pageNum"]!=null)
                //{
                //    _currentPageindex = int.Parse(Request["pageNum"].ToString());                 
                //}
                _currentPageindex = value;
            
            }
        }


        private int _totalCount = 0;

        /// <summary>
        /// 数据总共条数
        /// </summary>
        public int TotalCount
        {
            get { return _totalCount; }
            set { _totalCount = value; }
        }

        private int _numPerPage = 15;

        /// <summary>
        /// 每页显示的数据条数
        /// </summary>
        public int NumPerPage
        {
            get { return _numPerPage; }
            set {
                //if (Request["numPerPage"]!=null)
                //{
                //    _numPerPage = int.Parse(Request["numPerPage"].ToString());
                //}
                _numPerPage = value;
            
            }
        }




        private string _orderField = "";

        /// <summary>
        /// 排序方式
        /// </summary>
        public string OrderField
        {
            get { return _orderField; }
            set {

                //if (Request["orderField"]!=null)
                //{
                //    _orderField=Request["orderField"].ToString();
                    
                //}
                _orderField = value;
            
            }
        }

        #endregion

    }
}